<?php

class Adept_Validate_Url extends Adept_Validate_Abstract implements Adept_Validate_IValidator 
{
    
    public function validate($sender, $value)
    {
        if (!preg_match("/^(http|ftp|https):\/\/((\w+\d*)\.(\w+\d*))+$/", $value)) {
            $title = ($sender instanceof Adept_Component_Control) ? $sender->getTitle() : '';
            throw new Adept_Validate_Exception('NOT_VALID_URL', 0, 
                array(
                    'value' => $value,
                    'field' => $title,
                )
            );
        }
    }
    
    public function setAttributes($attributes) 
    {
    
    }

}